/*
 * @(#) OrderServiceImpl.java 2018-09-21
 *
 * Copyright 2018 NetEase.com, Inc. All rights reserved.
 */

package com.xinyi.order.provdier.impl;

import com.weibo.api.motan.config.springsupport.annotation.MotanService;
import com.xinyi.order.api.OrderService;
import com.xinyi.order.api.dto.OrderDto;
import com.xinyi.order.provdier.repository.jpa.OrderRepository;
import com.xinyi.order.provdier.repository.po.jpa.OrderBasePo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;


@Component
@Slf4j
@MotanService
public class OrderServiceImpl implements OrderService {

    @Resource
    private OrderRepository orderRepository;

    public OrderDto queryWithOrderId(String orderId) {
        OrderDto orderDto = new OrderDto();
        OrderBasePo orderBasePo = orderRepository.findByOrderId(orderId);
        if (orderBasePo != null) {
            orderDto.setOrderId(orderBasePo.getOrderId());
        }
        return orderDto;
    }
}
